<div class="row m-n">
    <div class="crumbs-bar" ng-show="!showChildView">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab" ng-show="!showChildView">
        <div tab heading="打印模板列表"  active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="main-area d-t-35 d-b-60">
                <div class="panel-bar clearfix">
                    <div class="pull-left">
                        <i></i><span translate>入库单模板</span>
                    </div>
                </div>
                <div class="clearfix m-b-xs">
                    <div class="pull-left print-tpl-card in-bill" ng-click="getTemplatesByType($index+1,printT.tempType)" ng-repeat="printT in inTempList track by $index">
                        <span translate>{{printT.tempTitle}}</span>
                        <span ng-if="printT.tempSubTitle" translate>({{printT.tempSubTitle}})</span>
                    </div>
                </div>
                <div class="panel-bar clearfix">
                    <div class="pull-left">
                        <i></i><span translate>出库单模板</span>
                    </div>
                </div>
                <div class="clearfix m-b-xs">
                    <div class="pull-left print-tpl-card out-bill" ng-click="getTemplatesByType(inTempList.length+$index+1,printT.tempType)" ng-repeat="printT in outTempList track by $index">
                        <span translate>{{printT.tempTitle}}</span>
                        <span ng-if="printT.tempSubTitle" translate>({{printT.tempSubTitle}})</span>
                    </div>
                </div>
                <div class="panel-bar clearfix">
                    <div class="pull-left">
                        <i></i><span translate>其他模板</span>
                    </div>
                </div>
                <div class="clearfix">
                    <div class="pull-left print-tpl-card other-bill" ng-click="getTemplatesByType(inTempList.length+outTempList.length+$index+1,printT.tempType)" ng-repeat="printT in otherTempList track by $index">
                        <span translate>{{printT.tempTitle}}</span>
                        <span ng-if="printT.tempSubTitle" translate>({{printT.tempSubTitle}})</span>
                    </div>
                </div>
            </div>
        </div>
        
        <div tab heading="{{printT.tempTitle + (printT.tempSubTitle ? '(' + printT.tempSubTitle + ')' : '')}}" 
            active="activeFlag[$index+1]" ng-if="activeFlag[$index+1]" ng-repeat="printT in inTempList.concat(outTempList).concat(otherTempList) track by $index">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addTemplate(printT.tempType)"
                            ng-disabled="!btnPermission.printTplAdd" translate translate-attr-title="{{!btnPermission.printTplAdd?'无权限执行此操作':''}}">新增</button>
                </div>
            </div>
            <div class="main-area d-b-15">
                <div yb-table-fixed class="table-fixed-wrap">
                    <div class="th-scroll-x">
                        <table class="table border-none">
                            <thead>
                            <tr>
                                <th width="50%" translate>模板名称</th>
                                <th width="25%" translate>默认模板</th>
                                <th width="25%" translate>操作</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="tempTpls.length > 0">
                        <table class="table border-none">
                            <tbody>
                            <tr ng-repeat="item in tempTpls track by $index">
                                <td class="overflow-dots" title="{{item.templateName}}" width="50%" translate>
                                    {{item.templateName}}
                                </td>
                                <td width="25%">
                                    <div ng-click="selectDefault(item)" ng-if="!!btnPermission.printTplDefault" style="cursor: pointer;">
                                        <div yb-check-circle circle-checked="item.isDefault"></div>
                                    </div>
                                </td>
                                <td width="25%">
                                    <button class="btn btn-operate" ng-click="update(printT.tempType,item.id)"
                                            ng-disabled="!btnPermission.printTplEdit" translate translate-attr-title="{{!btnPermission.printTplEdit?'无权限执行此操作':''}}">编辑
                                    </button>
                                    <button class="btn btn-operate" ng-click="deleteTemp(item.id, $index)"
                                            ng-disabled="(item.isDefault || (tempTpls.length==1)) || !btnPermission.printTplDel" translate translate-attr-title="{{!btnPermission.printTplDel?'无权限执行此操作':''}}">删除
                                    </button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="tempTpls.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
        </div>
    </div>
    <div ui-view ng-show="showChildView"></div>
</div>
